dswinton / domo-ifttt

Domoticz IFTTT Integration
9 stars 7 forks source link

Formatting device name not always working. #2

Open TheDukeSr opened 6 years ago

TheDukeSr commented 6 years ago

Great script! Thnx for sharing.

  1. Some device names just gets "cleared" (for example device "Lees Lamp") and results in empty $v variable after parsing line 52 and 53. -- Did not have time yet to figure out why some device names do this and some don't..

  2. Some of my devices have spaces in the name. Line 53 removes these and therefore device is not found anymore. -- Why not just remove spaces before and after device name (considered typo errors). But do not remove spaces in the name itself.

Line 52, 53 $v = preg_replace("/^[a-zA-Z0-9]+$/", '', $v); $v = str_replace(' ', '', $v);

Workaround: For now I just commented these 2 lines and it's working.

Using Domoticz on Raspberry V3b

mbnn commented 6 years ago

If I do that and comment those lines I still get:

Got requested device name: lamp kast Got 11 devices from Domoticz Device not found