laurent-martin / ets-to-homeassistant

script to convert ETS5 project file to a YAML configuration file suitable for Home Assistant
Apache License 2.0
52 stars 12 forks source link

`map_ets_function_to_ha_type': undefined local variable or method ` #16

Closed TheFelix93 closed 6 months ago

TheFelix93 commented 6 months ago

Hi,

I am running the script on windows with fresh installed ruby.

ETS Version 5.7.4 Build 1093

./ets_to_hass.rb --ha-knx --format homeass --full-name "PATH.knxproj" > ha.yaml

and get the following error.

./ets_to_hass.rb:246:in 'map_ets_function_to_ha_type': undefined local variable or method 'o' for #<ConfigurationImporter:0x00-025E-0_GA-79", "P-025E-0_GA-94", "P-025E-0_GA-109"], :custom=>{}, :floor=>"Dachgeschoss", :room=>"Ankleide"}, "P-025E-0_F-3"=:floor=>"Dachgeschoss", :room=>"Ankleide"}, "P-025E-0_F-6"=>{:name=>
...
rmat=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000001bcb9893268 @shift_period_suffix=nil, @shift_size=nil, @shift_agroc:0x000001bcbbecfd50 ./ets_to_hass.rb:84 (lambda)>> (NameError)

    case o[:type]
         ^
        from ./ets_to_hass.rb:297:in 'block in generate_homeass'
        from ./ets_to_hass.rb:291:in 'each_value'
        from ./ets_to_hass.rb:291:in 'generate_homeass'
        from ./ets_to_hass.rb:421:in '<main>'

I am not familiar with ruby and don't know whats the problem. Is this a known problem / mistake by my side?

Thanks in advance.

TheFelix93 commented 6 months ago

Fix works thanks.