Is it a bird? Is it a plane? Nah – just a Python class behaving like a dictionary.
|

Is it a bird? Is it a plane? Nah – just a Python class behaving like a dictionary.

For a container class with a dictionary with config values (among other members) I wanted easy reading access as if it was a dict itself. For that you only have to implement the __getitem__ method. You can extend the provided dict functionality for your class if needed like the following: All but the update method…

Finding Nemo or check a Python list if there is one or all elements matching a condition
|

Finding Nemo or check a Python list if there is one or all elements matching a condition

Yeah we all can loop, but can you any or all? Checking if condition matches for at least one element of an iterable (e.g. list, tuple, set) In Python you can write that nicer with the builtin method any(): But who doesn’t like a one-liner (that is understandable): Very similar is the case if you…

Mastering the chaos – subscribe to all MQTT topics of your Mosqitto server with console and Node-RED

Mastering the chaos – subscribe to all MQTT topics of your Mosqitto server with console and Node-RED

I wanted to know which topics are active on my MQTT server and if there were some skeletons in the closet I could get rid of. Many Iot devices, Node-RED flows and surely some unused topics or old retained topics lead to more or less MQTT being a chaotic museum of topics. This is just…

You are locked in here with me(dia) – function keys always on. How to deactivate?

You are locked in here with me(dia) – function keys always on. How to deactivate?

Pressing F5 does not refresh your view anymore but rewinds the current media?F11 does not run the selected JUnit test in Eclipse any more but activates Caps Lock? I have a Logitech K850 keyboard and I unintentionally turned on the function key lock (didn’t even know such a thing existed). Try the following: [Fn] +…

How not to be seen – a.k.a. Notepad++ Analyse Plugin hidden result window

How not to be seen – a.k.a. Notepad++ Analyse Plugin hidden result window

This short HowTo is about a problem I had with the Analyse Plugin for Notepad++. The Main window with the text and the one with the filters were still shown, but the result window disappeared and it wasn’t an instant fix to display it again. This is was worked for me:After a quick search I…

Better scratch your balls than your frozen windshield – MQTT warning for nightly low temperatures with Node-RED querying a weather API

Better scratch your balls than your frozen windshield – MQTT warning for nightly low temperatures with Node-RED querying a weather API

I have a talent to forget to cover my car before a night with temperature below zero and the next morning I have to scratch away all the ice. As I really don’t like that I decided to build a warning mechanism for that. I already had a Node-RED flow querying the weather API to…

Easy peasy – querying weather API in Node-RED and publishing the current temperature to a MQTT broker

Easy peasy – querying weather API in Node-RED and publishing the current temperature to a MQTT broker

Precondition: Have your lokal MQTT broker and Node-RED installed and setup or access to a remote one. I recently added a http request node querying a weather API to Node-RED. After extracting, the current temperature is then published on the local MQTT and can be used by all devices connected to the broker.In this example…

It was born like this – pre-enabling WiFi and SSH on Raspberry Pi OS and creating a user

It was born like this – pre-enabling WiFi and SSH on Raspberry Pi OS and creating a user

Most of my Raspberry Pis run headless (just remote console, no GUI). To remind myself and for your service I wrote this short memo how to set them up correctly. You can also find the same and much more Pi related information here, but I like to keep the stuff I need together in one…