CyBear-Jinni/cbj_app

Demo mode devices are hard coded

Closed this issue · 7 comments

I have just pushed the demo mode of the app and I used hard-coded values for the devices.

This is bad practice as we all know XD.

Please change the hard coded devices string that comes from the Hub (in demo mode).

You should create an object of that device with all the corresponding values, then use .toDts on it and then use .toJsonString.

'{"id":"96386cd0-419b-11ed-8246-e17a279f4d89","vendorUniqueId":"63b298","defaultName":"Guy Blinds","deviceStateGRPC":"ack","senderDeviceOs":"switcher","senderDeviceModel":"SwitcherDevicesTypes.switcherRunner","senderId":"94edb282-434a-11ed-bd96-f573a00b65aa","blindsSwitchState":"stop","deviceTypes":"blinds","compUuid":"34asdfrsd23gggg","deviceVendor":"switcherSmartHome","deviceDtoClass":"GenericBlindsDeviceDtos","stateMassage":"Hello World"}';

Should look like this

GenericBlindsDE guyBlinds = GenericBlindsDE(...);
DeviceHelper.convertDomainToJsonString(guyBlinds);

 String allRemoteCommandsBlinds = DeviceHelper.convertDomainToJsonString(guyBlinds);

I have just added to the Wiki instructions on how to get to the demo mode so use it to test that the app behaves the same

If you need any help with that you can ask in the cbj discord server

Hey! I'd like to take this up

Hi @Simran1604 I am removing you from Assignees but your pr will still be merged if it will be accepted

Thanks

I would like to contribute

@mufida1018 feal free to open pr for that, for any help I am in the discord server of CyBear Jinni

Done thanks