gjohansson-ST / pytrafikverket

python module for communicating with the swedish trafikverket api
MIT License
22 stars 7 forks source link

Wind Speed Max #6

Closed magma1447 closed 3 years ago

magma1447 commented 3 years ago

I am using pytrafikverket via Home Assistant, but I am missing a measurement that's most relevant to me.

Is it possible to add Measurement.Wind.ForceMax to the mix? I played around with Trafikverket's API console and found that it existed there, with that name. I also tried to patch this library and the Home Assistant module, but without success. Not sure where I failed in the flow. I am not too experienced with Python.

endor-force commented 3 years ago

Hey there, if it is in the api we could certainly add it. It has to be added to both pytrafikverket library and home assistant in that order.

magma1447 commented 3 years ago

That's what I tried, but failed with.

I made these two patches: https://pastebin.com/LP5Nd8Br https://pastebin.com/UtWGa5Pw

It's likely that I am missing something. My understanding for Python isn't too great, and even less how Home Assistant's modules works. It seemed simple though, besides the fact that it didn't work. :)

endor-force commented 3 years ago

https://github.com/home-assistant/home-assistant.io/pull/14256

endor-force commented 3 years ago

pytrafikverket is updated and pull requests created for home assistant docs and home assistant sensor code for trafikverket weatherstation

endor-force commented 3 years ago

It's now available in the 115 release of Home Assistant