A method for detecting an absence or a displacement of an aerosol-generating article in a cavity of an aerosol-generating device, wherein the aerosol-generating device comprises a cavity for removably receiving at least a portion of the aerosol-generating article, and an electrical heating arrangement comprising an electronic circuitry and a heating element operatively coupled to the electronic circuitry for heating an aerosol-forming substrate comprised in the aerosol-generating article when the aerosol-generating article is received in the cavity, the method comprising:
- measuring a temperature or an temperature increase of at least one portion of the electronic circuitry during operation of the electrical heating arrangement;
- detecting the absence or the displacement of the aerosol-generating article in the cavity in response to the temperature or the temperature increase having breached a predefined temperature threshold or a predefined temperature increase threshold, respectively;
- and
- stopping or restricting the operation of the electrical heating arrangement in response to the detecting the absence or the displacement of the aerosol-generating article.