Re: [mh] Adding ability to send arbitrary commands to Tasmota

Giles Godart-Brown <[email protected]> Thu, 4 Feb 2021 09:42:21 +0000
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
I've taken a quick look at mqtt.pm and cannot see where the lc 
conversion is occurring (cannot find lc anywhere) could this be higher 
up in the MQTT::Message library?

Sorry but run out of time to do more today.

Giles

On 03/02/2021 22:42, Paul Onley wrote:
> I was reluctant to suggest changing the existing MQTT_DEVICE code as I 
> had no idea how many people might be using it. I agree that returning 
> the raw JSON is the ideal option and my opinion as a user would be 
> that adding an option to return both versions from MQTT_DEVICE  with 
> documentation and strongly encouraging use of the raw output for 
> compatibility would be the best way to go.
>
> Again I am just a user and have little knowledge of how many people 
> might be using the MQTT_DEVICE code, you guys are the ones developing 
> this code and have a much better idea than I of the best way to 
> proceed going forward.
>
>
> On 2/3/21 3:16 PM, Giles Godart-Brown wrote:
>> How about we just add $self->{raw_json} to MQTT_Device to hold the 
>> mixed case JSON and $self->{lc_json} to Tasmota_HTTP for the lc 
>> version and document accordingly?
>>
>>
>> G
>>
>>> On 3 Feb 2021, at 21:01, Jeff Siddall via misterhouse-users 
>>> <[email protected]> wrote:
>>>
>>> I could be wrong, but I am guessing the number of people converting 
>>> from MQTT to Tasmota_HTTP could be counted on one hand (and are 
>>> probably already on this thread!) so it would likely be easier to 
>>> just convert the user code to be case insensitive instead of adding 
>>> a bunch of backward compatibility into the code base.  Perhaps a 
>>> note on the Wiki indicating that Tasmota_HTTP::Item presents the 
>>> JSON directly from Tasmota whereas MQTT lower cases all the data so 
>>> people are aware.
>>>
>>> Jeff
>>>
>>>> On 2021-02-03 3:39 p.m., Giles Godart-Brown wrote:
>>>>
>>>> I'm with Jeff on this one, MisterHouse shouldn't be messing with 
>>>> the case of a JSON message.
>>>>
>>>> The only exception I've currently coded in Tasmota_HTTP::Item is 
>>>> the edge case where someone sends a run_cmnd with no command 
>>>> string, in which case it just returns the state of the device in 
>>>> lower case (on or off) to be consistent with MisterHouse states.
>>>>
>>>> I'll take a look at MQTT_DEVICE in the morning and see where the lc 
>>>> is creeping in, maybe we can double up the JSON to have both mixed 
>>>> case and lower case keys and values in the response so current code 
>>>> doesn't break?
>>>>
>>>> G
>>>>
>>>
>>> ________________________________________________________
>>> To unsubscribe from this list, go to: 
>>> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>>>
>>
>> ________________________________________________________
>> To unsubscribe from this list, go to: 
>> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>>
>
>
>
> ________________________________________________________
> To unsubscribe from this list, go to: 
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.