{"action":"created","issue":{"url":"https://api.github.com/repos/domoticz/domoticz/issues/2454","repository_url":"https://api.github.com/repos/domoticz/domoticz","labels_url":"https://api.github.com/repos/domoticz/domoticz/issues/2454/labels{/name}","comments_url":"https://api.github.com/repos/domoticz/domoticz/issues/2454/comments","events_url":"https://api.github.com/repos/domoticz/domoticz/issues/2454/events","html_url":"https://github.com/domoticz/domoticz/issues/2454","id":328617229,"node_id":"MDU6SXNzdWUzMjg2MTcyMjk=","number":2454,"title":"API : LevelNames & LevelActions array (in selectors) are dead","user":{"login":"soif","id":101618,"node_id":"MDQ6VXNlcjEwMTYxOA==","avatar_url":"https://avatars1.githubusercontent.com/u/101618?v=4","gravatar_id":"","url":"https://api.github.com/users/soif","html_url":"https://github.com/soif","followers_url":"https://api.github.com/users/soif/followers","following_url":"https://api.github.com/users/soif/following{/other_user}","gists_url":"https://api.github.com/users/soif/gists{/gist_id}","starred_url":"https://api.github.com/users/soif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soif/subscriptions","organizations_url":"https://api.github.com/users/soif/orgs","repos_url":"https://api.github.com/users/soif/repos","events_url":"https://api.github.com/users/soif/events{/privacy}","received_events_url":"https://api.github.com/users/soif/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-06-01T18:26:35Z","updated_at":"2018-06-06T05:49:09Z","closed_at":"2018-06-02T05:54:31Z","author_association":"NONE","body":"Was working fine, until about one month.\r\n\r\nNow (v3.9476) when querying the API, the **LevelNames** field (used to be an array of `levels => names`) and the **LevelActions** field are wrongly replaced with an encoded string, ie\r\n\r\n\r\n\r\n```\r\n            [AddjMulti] => 1\r\n            [AddjMulti2] => 1\r\n            [AddjValue] => 0\r\n            [AddjValue2] => 0\r\n            [BatteryLevel] => 255\r\n            [CustomImage] => 9\r\n            [Data] => Off\r\n            [Description] => \r\n            [DimmerType] => none\r\n            [Favorite] => 1\r\n            [HardwareID] => 6\r\n            [HardwareName] => Dummy\r\n            [HardwareType] => Dummy (Does nothing, use for virtual switches only)\r\n            [HardwareTypeVal] => 15\r\n            [HaveDimmer] => 1\r\n            [HaveGroupCmd] => 1\r\n            [HaveTimeout] => \r\n            [ID] => 00000100\r\n            [Image] => Generic\r\n            [IsSubDevice] => \r\n            [LastUpdate] => 2018-02-04 17:40:47\r\n            [Level] => 0\r\n            [LevelActions] => fHx8fA==\r\n            [LevelInt] => 0\r\n            [LevelNames] => T2ZmfE9ufEF1dG98Q29uZm9ydHxIZ2Vs\r\n            [LevelOffHidden] => \r\n            [MaxDimLevel] => 100\r\n            [Name] => c.Salon\r\n            [Notifications] => false\r\n            [PlanID] => 3\r\n            [PlanIDs] => Array\r\n                (\r\n                    [0] => 3\r\n                )\r\n\r\n            [Protected] => \r\n            [SelectorStyle] => 0\r\n            [ShowNotifications] => 1\r\n            [SignalLevel] => -\r\n            [Status] => Off\r\n            [StrParam1] => \r\n            [StrParam2] => \r\n            [SubType] => Selector Switch\r\n            [SwitchType] => Selector\r\n            [SwitchTypeVal] => 18\r\n            [Timers] => false\r\n            [Type] => Light/Switch\r\n            [TypeImg] => Light\r\n            [Unit] => 1\r\n            [Used] => 1\r\n            [UsedByCamera] => \r\n            [XOffset] => 0\r\n            [YOffset] => 0\r\n            [idx] => 115\r\n```\r\n\r\nHTH"},"comment":{"url":"https://api.github.com/repos/domoticz/domoticz/issues/comments/394947900","html_url":"https://github.com/domoticz/domoticz/issues/2454#issuecomment-394947900","issue_url":"https://api.github.com/repos/domoticz/domoticz/issues/2454","id":394947900,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDk0NzkwMA==","user":{"login":"dannybloe","id":2369994,"node_id":"MDQ6VXNlcjIzNjk5OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2369994?v=4","gravatar_id":"","url":"https://api.github.com/users/dannybloe","html_url":"https://github.com/dannybloe","followers_url":"https://api.github.com/users/dannybloe/followers","following_url":"https://api.github.com/users/dannybloe/following{/other_user}","gists_url":"https://api.github.com/users/dannybloe/gists{/gist_id}","starred_url":"https://api.github.com/users/dannybloe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dannybloe/subscriptions","organizations_url":"https://api.github.com/users/dannybloe/orgs","repos_url":"https://api.github.com/users/dannybloe/repos","events_url":"https://api.github.com/users/dannybloe/events{/privacy}","received_events_url":"https://api.github.com/users/dannybloe/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T05:49:09Z","updated_at":"2018-06-06T05:49:09Z","author_association":"CONTRIBUTOR","body":"@gizmocuz maybe too late but shouldn't we just consider to restore the levelName/actionNames to non-decoded for backwards compatability and create a new attribute with the base64 encoding and use that in the GUI. That way, existing API uses out there have a change to migrate.\r\nThat shouldn't be too hard I guess. \r\n\r\nAgain, I said it before, it is usually not a good idea to change the API like this without having at least some basic way of versioning the API.\r\n\r\nHaving said that, if reverting this change isn't an option, then how about **always** adding Domoticz' version in the API response (next to the status attribute). That way, future API consumers can check for this attribute and act accordingly. "}}
{"actor":{"display_login":"dannybloe"}}