Repository navigation
Complete documented return values, keys and constants - #79
Merged
Merged
Conversation
- Return TRUE from IPS_Set*/Delete*/profile functions and IPS_RequestAction like documented - RegisterScript creates a read-only script with the default content of the kernel and returns its ID (IPSModuleStrict: whether it was created) - Add CategoryID, InstanceSupportsSearching/InstanceIsSearching/InstanceVisualizationType, ScriptCRC/ScriptSize/ScriptUpdated and URL/Limit/Translation to the IPS_Get* results; hide the internal Class key of IPS_GetModule - Wire up IPS_GetMedia and the other media functions to the MediaManager - SetVisualizationType is protected like in the kernel and is reflected in IPS_GetInstance - Remove ConnectParent/RequireParent/ForceParent from IPSModuleStrict, which are only available for IPSModule - Restore the documented timer signatures without the additional time parameters - Add missing constants and messages registered by the kernel (e.g. MODULETYPE_VISUALIZATION, SCRIPTTYPE_FLOW, DEBUG_FORMAT_*, INSTANCE_VISUALIZATION_TYPE_*, EVENT_DAY_*, IS_STANDBY, IM_REMOVEATTRIBUTE, SM_UPDATE, AM_*, LP_*, TP_*) - Validator: allow empty URLs, require braces for GUIDs like the kernel, fix typo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #78. This covers the P2 items from the comparison with the official docs (https://www.symcon.de/de/llms.txt) and the kernel source.
Return values
IPS_Set*,IPS_Delete*, the profile functions andIPS_RequestActionreturntrue, as documented. Before they returnednull.RegisterScriptnow really creates a script, like the kernel:<?php\n\n//Autogenerated scriptKeys
IPS_GetCategorynow containsCategoryID.IPS_GetInstancenow containsInstanceSupportsSearching,InstanceIsSearchingandInstanceVisualizationType.InstanceChangedfollows the simulated time.IPS_GetScriptnow containsScriptCRC,ScriptSizeandScriptUpdated, updated whenever the content changes.IPS_GetModulenow containsURL,LimitandTranslation. The stub's internalClasskey is no longer returned.IPS_GetMedia,IPS_GetMediaList,IPS_GetMediaListByType,IPS_GetMediaIDByFileandIPS_GetMediaIDByNamereturn real dataIPS_GetMediaContent,IPS_SetMediaContent,IPS_SetMediaFileandIPS_SetMediaCachedworkModule API
SetVisualizationTypeis protected, as in the kernel. It returnstrueand is reflected inIPS_GetInstance.ConnectParent,RequireParentandForceParentare removed from IPSModuleStrict. The docs say they are only available for IPSModule.$start/$currentTimeparameters. Before, a module overriding them with the documented signature hit a PHP fatal error.getTime, so legacy modules no longer need agetTimejust to register a timer.UpdateVisualizationValuereturnstrueand is typedboolin strict.Constants and messages
I compared ConstantStubs.php and MessageStubs.php against the constants the kernel registers (
IPSScriptEngine.cpp). These are added:MODULETYPE_VISUALIZATION,SCRIPTTYPE_FLOW,SCRIPTTYPE_IPSWORKFLOW,MEDIATYPE_IPSVIEW,MEDIATYPE_FORMINSTANCE_VISUALIZATION_TYPE_*,DEBUG_FORMAT_*EVENT_CONDITION_OPERATION_*,EVENT_DAY_*COLOR_TRANSPARENT,COLOR_ENCODING_*,USER_TYPE_*,REPLICATION_MODE_*,VARIABLE_ACTION_*IS_STANDBY,OM_CHANGELOCKED,OM_CHANGEHIDDENTITLE,OM_CHANGEHIDDENMAXIMIZEIM_REMOVEATTRIBUTE,VM_CHANGELOCKED,EM_CHANGEACTION,EM_*DAYOFTHEWEEKRULESM_UPDATE= 10705. The docs print 10704, which is a typo; the kernel usesIPS_SCRIPTMESSAGE + 5.SE_FLOWSCRIPT, plus theAM_*,LP_*andTP_*families with their base valuesAll existing values already matched. The legacy names
MEDIATYPE_DASHBOARDandEM_CHANGESCRIPTare kept.Validator
IsGUID).$this->ConnectParent/RequireParent/ForceParentfrom IPSModuleStrict. These calls would fail on a real system too.SetVisualizationTypefrom outside the module. It is protected now.Tests
tests/DocumentationAlignmentTest.phpwith 14 tests..styleand the JSON check are clean.SetVisualizationTypeis no longer public, so the validator no longer type-checks it.🤖 Generated with Claude Code