1. A method of securing a learning mode of a device, the device including a secure first command transmitter and a command receiver, the command receiver being capable of driving an element providing for at least one of the security and the comfort of occupants of a building, the method comprising: providing at least one first activation function for switching the command receiver to the learning mode, the first activation function being associated with the secure first command transmitter; providing at least one second activation function for switching the command receiver to the learning mode, the second activation function being associated with at least one of the command receiver, a second command transmitter, and a main power supply; applying at least one action to the secure first command transmitter; the application of the at least one action to the secure first command transmitter causing a disabling of the second activation function for switching the command receiver to the learning mode; the disabling of the second activation function preventing the command receiver from being switched to the learning mode by the second activation function; and maintaining a capability of the secure first command transmitter to switch the command receiver to the learning mode via the first activation function after the disabling of the second activation function.